package service

import (
	"context"
	"tieup/internal/model"
	"tieup/internal/repository"
)

type UserService struct {
	userRepo *repository.UserRepository
}

func NewUserService(userRepo *repository.UserRepository) *UserService {
	return &UserService{userRepo: userRepo}
}

func (s *UserService) CreateUser(ctx context.Context, user *model.User) error {
	return s.userRepo.CreateUser(ctx, user)
}

func (s *UserService) GetUserByEmail(ctx context.Context, email string) (*model.User, error) {
	return s.userRepo.GetUserByEmail(ctx, email)
}

// 新添加的方法
func (s *UserService) GetUserByID(ctx context.Context, id uint) (*model.User, error) {
	return s.userRepo.GetUserByID(ctx, id)
}
